var OpconfigModalDemo = angular.module('FusionStorUI.opconfig', []);
OpconfigModalDemo.controller('OpconfigModalCtrl', ['$scope','$modal', '$http', function($scope, $modal, $http) {
    var modalInstance;
    $scope.templateData = '';
    $scope.open = function(url) {  
        $scope.item = {};
        $http.get(url).success(function(data){
            $scope.templateData = data;
            modalInstance = $modal.open({  
                template : $scope.templateData,
                controller : OpconfigModalInstanceCtrl,  
                backdrop:'static',  
                resolve : { 
                    item : function() {  
                        return $scope.item;  
                    }  
                }  
            });  
        });  
    };  

    $scope.close = function() {
        modalInstance.dismiss('cancel');  
    }
}]); 
var OpconfigModalInstanceCtrl = function($scope, $modalInstance, item) {  
    $scope.item = item;  
    $scope.selected = {  
        item : $scope.item 
    };  
    $scope.ok = function() {  
    };  
    $scope.update = function(){  
        submit_opconfig_update();
    }; 
    $scope.sysconfig_policy_create = function() {
        submit_sysconfig_policy();
    };
    $scope.cancel = function() {  
        $modalInstance.dismiss('cancel');  
    };  
};  
